<%@ page import="top.didi.study.javawebjdbc.entity.TBClass" %>
<%@ page import="top.didi.study.javawebjdbc.dao.TbClassDAO" %><%--
  Created by IntelliJ IDEA.
  User: 19867
  Date: 2024/5/16
  Time: 10:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加班级数据</title>
</head>
<body>
  <%
    request.setCharacterEncoding("UTF-8");
      TBClass tbClass = new TBClass();
      tbClass.setClassname(request.getParameter("classname"));
      tbClass.setClassinfo(request.getParameter("classinfo"));
      int i = TbClassDAO.insert(tbClass);
      String massage = "添加失败";
      if(i==1){
        massage = "添加成功";
      }

  %>

<script>
  alert("<%=massage%>");
  location.href = 'insert.jsp';
</script>

</body>
</html>
